package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.query.MallProductDescriptionLanguageQuery;
import com.novax.ex.activity.open.model.request.MallProductDescriptionLanguageRequest;
import com.novax.ex.activity.open.model.response.MallProductDescriptionLanguageResponse;
import com.novax.ex.common.results.ReturnResult;
import com.novax.ex.common.util.PageUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

/**
 * Description: 简介配置
 *
 * @author Deucalion@novax.email
 * @date 2023/2/21 16:05
 */
@Tag(name = "一元购-简介配置", description = "简介配置")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "MallProductDescriptionLanguageInnerApi", contextId = "MallProductDescriptionLanguageInnerApi")
public interface MallProductDescriptionLanguageInnerApi {

    @Operation(summary = "新增", description = "新增")
    @Parameters({
            @Parameter(name = "language",description = "语言"),
            @Parameter(name = "adminId",description = "管理员ID")
    })
    @PostMapping("/v3/private/mall/product/description/add")
    ReturnResult add(
            @RequestHeader("language") String language,
            @RequestParam("adminId") Long adminId,
            @Valid @RequestBody MallProductDescriptionLanguageRequest request,
            BindingResult bindingResult);

    @Operation(summary = "修改", description = "修改")
    @Parameters({
            @Parameter(name = "language",description = "语言"),
            @Parameter(name = "adminId",description = "管理员ID")
    })
    @PutMapping("/v3/private/mall/product/description/modify")
    ReturnResult modify(
            @RequestHeader("language") String language,
            @RequestParam("adminId") Long adminId,
            @Valid @RequestBody MallProductDescriptionLanguageRequest request,
            BindingResult bindingResult);

    @Operation(summary = "删除", description = "删除")
    @Parameters({
            @Parameter(name = "id",description = "id"),
            @Parameter(name = "language",description = "语言")
    })
    @DeleteMapping("/v3/private/mall/product/description/remove/{id}")
    ReturnResult remove(
            @PathVariable Long id,
            @RequestHeader("language") String language);

    @Operation(summary = "列表", description = "列表")
    @GetMapping("/v3/private/mall/product/description/list")
    ReturnResult<PageUtil<MallProductDescriptionLanguageResponse>> list(
            @RequestHeader("language") String language,
            @ParameterObject MallProductDescriptionLanguageQuery query);

    @Operation(summary = "详情", description = "详情")
    @GetMapping("/v3/private/mall/product/description/detail/{id}")
    ReturnResult<MallProductDescriptionLanguageResponse> detail(
            @PathVariable Long id,
            @RequestHeader("language") String language);
}
